﻿using System;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using DLV.Library.Utilities;
using Microsoft.ApplicationBlocks.Data;

namespace DLV.Data
{
    public class SQL
    {
        public static string ConnectString
        {
            get { return ConfigurationManager.ConnectionStrings["SiteDataServer"].ConnectionString; }
        }
        public static object GetNull(object field)
        {
            return Null.GetNull(field, DBNull.Value);
        }

        #region General
        public static void ExecuteSql(string sqlQueryString)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ExecuteSql", sqlQueryString);
        }
        #endregion

        #region AdminPage
        public static int InsertAdminPage(int parentId, string name, string source, int orderView, bool visible, bool locked)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminPageInsert", GetNull(parentId), name, source, orderView, visible, locked));
        }

        public static void UpdateAdminPage(int adminPageId, int parentId, string name, string source, int orderView, bool visible, bool locked)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminPageUpdate", adminPageId, GetNull(parentId), name, source, orderView, visible, locked);
        }

        public static void DeleteAdminPage(int adminPageId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminPageDelete", adminPageId);
        }

        public static IDataReader GetAdminPage(int adminPageId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminPageGet", adminPageId);
        }

        public static IDataReader ListAdminPage()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminPageList");
        }
        #endregion

        #region AdminUser
        public static int InsertAdminUser(string username, string password, bool isAdministrator, bool deleted)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminUserInsert", username, password, isAdministrator, deleted));
        }

        public static int UpdateAdminUser(int userId, string username, string password, bool isAdministrator, bool deleted)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminUserUpdate", userId, username, password, isAdministrator, deleted));
        }

        public static void DeleteAdminUser(int userId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminUserDelete", userId);
        }

        public static IDataReader GetAdminUser(int userId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserGet", userId);
        }

        public static IDataReader GetAdminUser(string username)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserGetByUsername", username);
        }

        public static IDataReader GetAdminUser(string username, string password)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserLogin", username, password);
        }

        public static IDataReader ListAdminUser()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserList");
        }
        public static IDataReader ListAdminUserByReturn()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserListReturn");
        }

        #endregion

        #region AdminWorkFlow
        public static int InsertAdminWorkFlow(int fromId, int toId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminWorkFlowInsert", fromId, toId));
        }

        public static int UpdateAdminWorkFlow(int workFlowId, int fromId, int toId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminWorkFlowUpdate", workFlowId, fromId, toId));
        }

        public static void DeleteAdminWorkFlow(int workFlowId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminWorkFlowDelete", workFlowId);
        }

        public static IDataReader GetAdminWorkFlow(int workFlowId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminWorkFlowGet", workFlowId);
        }

        public static IDataReader ListAdminWorkFlow()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminWorkFlowList");
        }
        #endregion

        #region AdminUserRole
        public static int InsertAdminUserRole(int userId, int roleId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminUserRoleInsert", userId, roleId));
        }

        public static int UpdateAdminUserRole(int userRoleId, int userId, int roleId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminUserRoleUpdate", userRoleId, userId, roleId));
        }

        public static void DeleteAdminUserRole(int userRoleId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminUserRoleDelete", userRoleId);
        }

        public static IDataReader GetAdminUserRole(int userRoleId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserRoleGet", userRoleId);
        }

        public static IDataReader ListAdminUserRole()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserRoleList");
        }
        #endregion

        #region AdminRole
        /**Thêm mới một dòng trong bảng  AdminRole gồm 1 tham số truyền vào:Name */
        public static int InsertAdminRole(string roleName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminRoleInsert", GetNull(roleName)));
        }
        /** Cập nhật bảng AdminRole gồm 1 tham số truyền vào:ID */
        public static void UpdateAdminRole(int roleId, string roleName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminRoleUpdate", GetNull(roleId), GetNull(roleName));
        }
        /** Xóa một dòng trong bảng AdminRole có 1 tham số: ID */
        public static void DeleteAdminRole(int roleId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminRoleDelete", GetNull(roleId));
        }
        /** Lấy một dòng trong bảng AdminRole theo ID */
        public static IDataReader GetAdminRole(int roleId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminRoleGet", GetNull(roleId));
        }
        /** Lấy dữ liệu trong bảng AdminRole */
        public static IDataReader ListAdminRole()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminRoleList");
        }

        public static IDataReader ListAdminRoleToByUser(int userId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminRoleToByUser", userId);
        }

        /** Lấy danh sách Role của một userID*/
        public static IDataReader ListAdminUserRoleByUserID(int userid)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminUserRoleListByUserID", GetNull(userid));
        }
        #endregion

        #region AdminPageRole
        public static int InsertAdminPageRole(int pageid, int roleid)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AdminPageRoleInsert", pageid, roleid));
        }
        public static void UpdateAdminPageRole(int id, int pageid, int roleid)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminPageRoleUpdate", id, pageid, roleid);
        }
        public static void DeleteAdminPageRole(int id)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AdminPageRoleDelete", id);
        }
        public static IDataReader GetAdminPageRole(int id)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminPageRoleGet", id);
        }
        public static IDataReader ListAdminPageRole()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminPageRoleList");
        }
        // lấy danh sách PageID theo các RoleID của 1 user id
        public static IDataReader ListAdminPageByRole(int userid)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AdminPageRoleListByUserID", userid);
        }
        #endregion

        #region National
        public static int InsertNational(int continentId, string nationalName, decimal priceMadeVisa)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "NationalInsert", continentId, nationalName, priceMadeVisa));
        }

        public static void UpdateNational(int nationalId, int continentId, string nationalName, decimal priceMadeVisa)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "NationalUpdate", nationalId, continentId, nationalName, priceMadeVisa);
        }

        public static void DeleteNational(int nationalId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "NationalDelete", nationalId);
        }

        public static IDataReader GetNational(int nationalId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "NationalGet", nationalId);
        }

        public static IDataReader ListNational()
        {
            return SqlHelper.ExecuteReader(ConnectString, "NationalList");
        }

        public static IDataReader ListNationalByContinent(int continent)
        {
            return SqlHelper.ExecuteReader(ConnectString, "NationalListByContinent", continent);
        }
        #endregion

        #region City
        public static int InsertCity(int nationalId, string cityName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "CityInsert", nationalId, cityName));
        }

        public static void UpdateCity(int cityId, int nationalId, string cityName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "CityUpdate", cityId, nationalId, cityName);
        }

        public static void DeleteCity(int cityId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "CityDelete", cityId);
        }

        public static IDataReader GetCity(int cityId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CityGet", cityId);
        }

        public static IDataReader ListCity()
        {
            return SqlHelper.ExecuteReader(ConnectString, "CityList");
        }
        public static IDataReader ListCityByNational(int countryId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CityListByNational", countryId);
        }
        #endregion

        #region District
        public static int InsertDistrict(int cityId, string districtName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "DistrictInsert", cityId, districtName));
        }

        public static void UpdateDistrict(int districtId, int cityId, string districtName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "DistrictUpdate", districtId, cityId, districtName);
        }

        public static void DeleteDistrict(int districtId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "DistrictDelete", districtId);
        }

        public static IDataReader GetDistrict(int districtId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "DistrictGet", districtId);
        }

        public static IDataReader ListDistrict()
        {
            return SqlHelper.ExecuteReader(ConnectString, "DistrictList");
        }
        public static IDataReader ListDistrictByCity(int cityId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "DistrictListByCityID", cityId);
        }
        #endregion

        #region Ward
        public static int InsertWard(int districtId, string wardName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "WardInsert", districtId, wardName));
        }

        public static void UpdateWard(int wardId, int districtId, string wardName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "WardUpdate", wardId, districtId, wardName);
        }

        public static void DeleteWard(int wardId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "WardDelete", wardId);
        }

        public static IDataReader GetWard(int wardId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "WardGet", wardId);
        }

        public static IDataReader ListWard()
        {
            return SqlHelper.ExecuteReader(ConnectString, "WardList");
        }

        public static IDataReader ListWardByDistrict(int districtId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "WardListByDistrictID", districtId);
        }
        #endregion

        #region Language
        public static int InsertLanguage(string languageName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "LanguageInsert", languageName));
        }

        public static void UpdateLanguage(int languageId, string languageName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LanguageUpdate", languageId, languageName);
        }

        public static void DeleteLanguage(int languageId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LanguageDelete", languageId);
        }

        public static IDataReader GetLanguage(int languageId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "LanguageGet", languageId);
        }

        public static IDataReader ListLanguage()
        {
            return SqlHelper.ExecuteReader(ConnectString, "LanguageList");
        }
        #endregion

        #region TravelGuide
        public static int InsertTravelGuide(string avatar, string fullName, DateTime birthday, string gender, string phone, string email, string info, string identityCard, int level, string languages, string facebook, string googlePlus, string twitter, int contientId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TravelGuideInsert", avatar, fullName, birthday, gender, phone, email, info, identityCard, level, languages, facebook, googlePlus, twitter, contientId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateTravelGuide(int travelGuideId, string avatar, string fullName, DateTime birthday, string gender, string phone, string email, string info, string identityCard, int level, string languages, string facebook, string googlePlus, string twitter, int contientId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuideUpdate", travelGuideId, avatar, fullName, birthday, gender, phone, email, info, identityCard, level, languages, facebook, googlePlus, twitter, contientId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteTravelGuide(int travelGuideId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuideDelete", travelGuideId);
        }

        public static IDataReader GetTravelGuide(int travelGuideId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideGet", travelGuideId);
        }

        public static IDataReader ListTravelGuide()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideList");
        }
        #endregion

        #region TravelGuidePrice
        public static int InsertTravelGuidePrice(string travelGuidePriceName, int level, int languageId, int scheduleId, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, decimal extraMoney)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TravelGuidePriceInsert", travelGuidePriceName, level, languageId, scheduleId, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, extraMoney));
        }

        public static void UpdateTravelGuidePrice(int travelGuidePriceId, string travelGuidePriceName, int level, int languageId, int scheduleId, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, decimal extraMoney)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuidePriceUpdate", travelGuidePriceId, travelGuidePriceName, level, languageId, scheduleId, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, extraMoney);
        }

        public static void DeleteTravelGuidePrice(int travelGuidePriceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuidePriceDelete", travelGuidePriceId);
        }

        public static IDataReader GetTravelGuidePrice(int travelGuidePriceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuidePriceGet", travelGuidePriceId);
        }

        public static IDataReader ListTravelGuidePrice()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuidePriceList");
        }
        public static IDataReader ListTravelGuidePriceByTravelGuide(int travelGuideId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuidePriceListByTravelGuide", travelGuideId);
        }
        #endregion

        #region TravelGuideCash
        public static int InsertTravelGuideCash(int travelGuideId, int travelGuidePriceId, DateTime beginDate, DateTime endDate, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TravelGuideCashInsert", travelGuideId, travelGuidePriceId, beginDate, endDate, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateTravelGuideCash(int travelGuideCashId, int travelGuideId, int travelGuidePriceId, DateTime beginDate, DateTime endDate, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuideCashUpdate", travelGuideCashId, travelGuideId, travelGuidePriceId, beginDate, endDate, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteTravelGuideCash(int travelGuideCashId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TravelGuideCashDelete", travelGuideCashId);
        }

        public static IDataReader GetTravelGuideCash(int travelGuideCashId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideCashGet", travelGuideCashId);
        }

        public static IDataReader ListTravelGuideCash()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideCashList");
        }
        public static IDataReader ListTravelGuideCashBySchedule(int scheduleId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideCashListBySchedule", scheduleId);
        }
        public static IDataReader ListTravelGuideCashByIds(string travelGuideCashIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideCashListByIds", travelGuideCashIds);
        }
        public static IDataReader ListTravelGuideBy(string level,string gender,int language)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TravelGuideListBy", level, gender, language);
        }
        #endregion
       
        #region Viand
        public static int InsertViand(string viandName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status) 
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "ViandInsert", viandName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));    
        }

        public static void UpdateViand(int viandId, string viandName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status) 
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ViandUpdate", viandId, viandName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);    
        }

        public static void DeleteViand(int viandId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ViandDelete", viandId);    
        }

        public static IDataReader GetViand(int viandId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ViandGet", viandId);    
        }

        public static IDataReader ListViand()
        {
            return SqlHelper.ExecuteReader(ConnectString, "ViandList");
        }

        public static IDataReader ListViandById(string viandIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ViandListById", viandIds);
        }

        #endregion

        #region Menu
        public static int InsertMenu(int restaurantId, int menuTypeId, string viands, string menuName, string sortDescription, string detailDescription, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "MenuInsert", restaurantId, menuTypeId, viands, menuName, sortDescription, detailDescription, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateMenu(int menuId, int restaurantId, int menuTypeId, string viands, string menuName, string sortDescription, string detailDescription, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "MenuUpdate", menuId, restaurantId, menuTypeId, viands, menuName, sortDescription, detailDescription, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteMenu(int menuId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "MenuDelete", menuId);
        }

        public static IDataReader GetMenu(int menuId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "MenuGet", menuId);
        }

        public static IDataReader ListMenu()
        {
            return SqlHelper.ExecuteReader(ConnectString, "MenuList");
        }
        public static IDataReader ListMenuByRestaurantAndMenuType(int restaurantId, int menuTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "MenuListByRestaurantAndMenuType",restaurantId,menuTypeId);
        }
        #endregion

        #region MenuType
        public static int InsertMenuType(string menuTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "MenuTypeInsert", menuTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateMenuType(int menuTypeId, string menuTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "MenuTypeUpdate", menuTypeId, menuTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteMenuType(int menuTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "MenuTypeDelete", menuTypeId);
        }

        public static IDataReader GetMenuType(int menuTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "MenuTypeGet", menuTypeId);
        }

        public static IDataReader ListMenuType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "MenuTypeList");
        }
        #endregion

        #region Restaurant
        public static int InsertRestaurant(int partnerId, int restaurantTypeId, string restaurantFullName, string restaurantSortName, string restaurantEnglishName, string sortDescription, string detailDescription, int builtYear, int continentId, int nationalid, int cityId, int districtId, int wardId, string address, string representName, string representPhone, string representHotline, string representFax, string representEmail, string representWebsite, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "RestaurantInsert", partnerId, restaurantTypeId, restaurantFullName, restaurantSortName, restaurantEnglishName, sortDescription, detailDescription, builtYear, continentId, nationalid, cityId, districtId, wardId, address, representName, representPhone, representHotline, representFax, representEmail, representWebsite, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateRestaurant(int restaurantId, int partnerId, int restaurantTypeId, string restaurantFullName, string restaurantSortName, string restaurantEnglishName, string sortDescription, string detailDescription, int builtYear, int continentId, int nationalid, int cityId, int districtId, int wardId, string address, string representName, string representPhone, string representHotline, string representFax, string representEmail, string representWebsite, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RestaurantUpdate", restaurantId, partnerId, restaurantTypeId, restaurantFullName, restaurantSortName, restaurantEnglishName, sortDescription, detailDescription, builtYear, continentId, nationalid, cityId, districtId, wardId, address, representName, representPhone, representHotline, representFax, representEmail, representWebsite, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteRestaurant(int restaurantId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RestaurantDelete", restaurantId);
        }

        public static IDataReader GetRestaurant(int restaurantId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RestaurantGet", restaurantId);
        }

        public static IDataReader ListRestaurant()
        {
            return SqlHelper.ExecuteReader(ConnectString, "RestaurantList");
        }
        #endregion

        #region RestaurantType
        public static int InsertRestaurantType(string restaurantTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "RestaurantTypeInsert", restaurantTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateRestaurantType(int restaurantTypeId, string restaurantTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RestaurantTypeUpdate", restaurantTypeId,restaurantTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteRestaurantType(int restaurantTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RestaurantTypeDelete", restaurantTypeId);
        }

        public static IDataReader GetRestaurantType(int restaurantTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RestaurantTypeGet", restaurantTypeId);
        }

        public static IDataReader ListRestaurantType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "RestaurantTypeList");
        }
        #endregion

        #region Partner
        public static int InsertPartner(string logo, string partnerName, string partnerSortName, string partnerEnglishName, string phone, string telephone, string hotline, string fax, string email, string represent, string regency, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "PartnerInsert", logo, partnerName, partnerSortName, partnerEnglishName, phone, telephone, hotline, fax, email, represent, regency, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdatePartner(int partnerId, string logo, string partnerName, string partnerSortName, string partnerEnglishName, string phone, string telephone, string hotline, string fax, string email, string represent, string regency, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PartnerUpdate", partnerId, logo, partnerName, partnerSortName, partnerEnglishName, phone, telephone, hotline, fax, email, represent, regency, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeletePartner(int partnerId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PartnerDelete", partnerId);
        }

        public static IDataReader GetPartner(int partnerId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PartnerGet", partnerId);
        }

        public static IDataReader ListPartner()
        {
            return SqlHelper.ExecuteReader(ConnectString, "PartnerList");
        }
        public static IDataReader ListInsurancePartner()
        {
            return SqlHelper.ExecuteReader(ConnectString, "InsurancePartnerList");
        }
        #endregion

        #region Hotel
        public static int InsertHotel(int partnerId, int hotelTypeId, string hotelFullName, string hotelSortName, string hotelEnglishName, string sortDescription, string detailDescrtiption, int floorQuantity, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, string representName, string representPhone, string representHotline, string representFax, string representEmail, string representWebsite, string utilities, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "HotelInsert", partnerId, hotelTypeId, hotelFullName, hotelSortName, hotelEnglishName, sortDescription, detailDescrtiption, floorQuantity, continentId, nationalId, cityId, districtId, wardId, address, representName, representPhone, representHotline, representFax, representEmail, representWebsite, utilities, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateHotel(int hotelId, int partnerId, int hotelTypeId, string hotelFullName, string hotelSortName, string hotelEnglishName, string sortDescription, string detailDescrtiption, int floorQuantity, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, string representName, string representPhone, string representHotline, string representFax, string representEmail, string representWebsite, string utilities, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "HotelUpdate", hotelId, partnerId, hotelTypeId, hotelFullName, hotelSortName, hotelEnglishName, sortDescription, detailDescrtiption, floorQuantity, continentId, nationalId, cityId, districtId, wardId, address, representName, representPhone, representHotline, representFax, representEmail, representWebsite, utilities, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteHotel(int hotelId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "HotelDelete", hotelId);
        }

        public static IDataReader GetHotel(int hotelId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "HotelGet", hotelId);
        }
         public static IDataReader GetHotelByRoom(int roomId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "HotelByRoomGet", roomId);
        }
        public static IDataReader ListHotel()
        {
            return SqlHelper.ExecuteReader(ConnectString, "HotelList");
        }
        #endregion

        #region HotelType
        public static int InsertHotelType(string hotelTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "HotelTypeInsert", hotelTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateHotelType(int hotelTypeId, string hotelTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "HotelTypeUpdate", hotelTypeId, hotelTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteHotelType(int hotelTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "HotelTypeDelete", hotelTypeId);
        }

        public static IDataReader GetHotelType(int hotelTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "HotelTypeGet", hotelTypeId);
        }

        public static IDataReader ListHotelType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "HotelTypeList");
        }
        #endregion

        #region Room
        public static int InsertRoom(int hotelId, int roomTypeId, string utilities, string roomName, string sortDescription, string detailDescription, int roomQuantity, int personQuantity, int acreage, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "RoomInsert", hotelId, roomTypeId, utilities, roomName, sortDescription, detailDescription, roomQuantity, personQuantity, acreage, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateRoom(int roomId, int hotelId, int roomTypeId, string utilities, string roomName, string sortDescription, string detailDescription, int roomQuantity, int personQuantity, int acreage, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RoomUpdate", roomId, hotelId, roomTypeId, utilities, roomName, sortDescription, detailDescription, roomQuantity, personQuantity, acreage, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteRoom(int roomId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RoomDelete", roomId);
        }

        public static IDataReader GetRoom(int roomId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomGet", roomId);
        }

        public static IDataReader ListRoom()
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomList");
        }
        public static IDataReader ListRoomByHotel(int hotelId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomListByHotelID", hotelId);
        }
        public static IDataReader ListRoomByHotelAndType(int hotelId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomListByHotelIDAndType", hotelId);
        }
        #endregion

        #region RoomType
        public static int InsertRoomType(string roomTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "RoomTypeInsert", roomTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateRoomType(int roomTypeId, string roomTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RoomTypeUpdate", roomTypeId, roomTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteRoomType(int roomTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "RoomTypeDelete", roomTypeId);
        }

        public static IDataReader GetRoomType(int roomTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomTypeGet", roomTypeId);
        }

        public static IDataReader ListRoomType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomTypeList");
        }
        public static IDataReader ListRoomTypeByHotel(int hotelId, string season)
        {
            return SqlHelper.ExecuteReader(ConnectString, "RoomTypeListByHotel", hotelId, season);
        }
        #endregion

        #region Utility
        public static int InsertUtility(string utilityName, int utilityType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "UtilityInsert", utilityName, utilityType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateUtility(int utilityId, string utilityName, int utilityType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "UtilityUpdate", utilityId, utilityName, utilityType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteUtility(int utilityId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "UtilityDelete", utilityId);
        }

        public static IDataReader GetUtility(int utilityId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "UtilityGet", utilityId);
        }

        public static IDataReader ListUtility()
        {
            return SqlHelper.ExecuteReader(ConnectString, "UtilityList");
        }
        #endregion

        #region Visa
        public static int InsertVisa(int partnerId, string visaName, string sortDescription, string detailDescription, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status,int nationalId)
        {
            return Convert.ToInt32((string) SqlHelper.ExecuteScalar(ConnectString, "VisaInsert", partnerId, visaName, sortDescription, detailDescription, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status), nationalId);
        }

        public static void UpdateVisa(int visaId, int partnerId, string visaName, string sortDescription, string detailDescription, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int nationalId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaUpdate", visaId, partnerId, visaName, sortDescription, detailDescription, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, nationalId);
        }

        public static void DeleteVisa(int visaId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaDelete", visaId);
        }

        public static IDataReader GetVisa(int visaId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaGet", visaId);
        }

        public static IDataReader ListVisa()
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaList");
        }
        #endregion

        #region VisaType
        public static int InsertVisaType(string visaTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "VisaTypeInsert", visaTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateVisaType(int visaTypeId, string visaTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaTypeUpdate", visaTypeId, visaTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteVisaType(int visaTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaTypeDelete", visaTypeId);
        }

        public static IDataReader GetVisaType(int visaTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaTypeGet", visaTypeId);
        }

        public static IDataReader ListVisaType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaTypeList");
        }
        #endregion

        #region VisaPrice
        public static int InsertVisaPrice(int visaId, int visaTypeId, int registerNational, int nationalId, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, decimal stranlate, decimal otherCosts, int ageId, int visaQuantity, decimal totalPrice)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "VisaPriceInsert", visaId, visaTypeId, registerNational, nationalId, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, stranlate,otherCosts,ageId, visaQuantity, totalPrice));
        }

        public static void UpdateVisaPrice(int visaPriceId, int visaId, int visaTypeId, int registerNational, int nationalId, decimal price, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, decimal stranlate, decimal otherCosts, int ageId, int visaQuantity, decimal totalPrice)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaPriceUpdate", visaPriceId, visaId, visaTypeId, registerNational, nationalId, price, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, stranlate, otherCosts, ageId, visaQuantity, totalPrice);
        }

        public static void DeleteVisaPrice(int visaPriceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "VisaPriceDelete", visaPriceId);
        }

        public static IDataReader GetVisaPrice(int visaPriceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaPriceGet", visaPriceId);
        }

        public static IDataReader ListVisaPrice()
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaPriceList");
        }
        public static IDataReader ListVisaPriceByIds(string visaPriceIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaPriceListByIds", visaPriceIds);
        }
        public static IDataReader ListPriceByVisa(int partnerId, int visaTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "VisaByType_Partner", partnerId, visaTypeId);
        }
        #endregion

        #region Insurance
        public static int InsertInsurance(int partnerId, string insuranceName, string insuranceLevel, DateTime insuranceBegin, string sortDescription, string detailDescription, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "InsuranceInsert", partnerId, insuranceName, insuranceLevel, insuranceBegin, sortDescription, detailDescription, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateInsurance(int insuranceId, int partnerId, string insuranceName, string insuranceLevel, DateTime insuranceBegin, string sortDescription, string detailDescription, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "InsuranceUpdate", insuranceId, partnerId, insuranceName, insuranceLevel, insuranceBegin, sortDescription, detailDescription, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteInsurance(int insuranceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "InsuranceDelete", insuranceId);
        }

        public static IDataReader GetInsurance(int insuranceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "InsuranceGet", insuranceId);
        }

        public static IDataReader ListInsurance()
        {
            return SqlHelper.ExecuteReader(ConnectString, "InsuranceList");
        }
        #endregion

        #region Ticket
        public static int InsertTicket(int concernId, int scheduleId, string ticketName, string sortDescription, string detailDescription, int typeId, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TicketInsert", concernId, scheduleId, ticketName, sortDescription, detailDescription, typeId,  createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateTicket(int ticketId, int concernId, int scheduleId, string ticketName, string sortDescription, string detailDescription, int typeId,  int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TicketUpdate", ticketId, concernId, scheduleId, ticketName, sortDescription, detailDescription, typeId, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteTicket(int ticketId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TicketDelete", ticketId);
        }

        public static IDataReader GetTicket(int ticketId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TicketGet", ticketId);
        }

        public static IDataReader ListTicket()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TicketList");
        }

        public static IDataReader ListTicketByType(int typeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TicketListByType", typeId);
        }
        public static IDataReader TicketListByConcern(int typeId,int concernId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TicketListByConcern",typeId, concernId);
        }
        #endregion

        #region Concern
        public static int InsertConcern(string concernFullName, string concernSortName, string concernEnglishName, string sortDescription, string detailDescription, string phone, string hotline, string fax, string email, string website, string representName, string regency, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int concernType, int partnetId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "ConcernInsert", concernFullName, concernSortName, concernEnglishName, sortDescription, detailDescription, phone, hotline, fax, email, website, representName, regency, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, concernType, partnetId));
        }

        public static void UpdateConcern(int concernId, string concernFullName, string concernSortName, string concernEnglishName, string sortDescription, string detailDescription, string phone, string hotline, string fax, string email, string website, string representName, string regency, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int concernType, int partnetId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ConcernUpdate", concernId, concernFullName, concernSortName, concernEnglishName, sortDescription, detailDescription, phone, hotline, fax, email, website, representName, regency, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, concernType, partnetId);
        }

        public static void DeleteConcern(int concernId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ConcernDelete", concernId);
        }

        public static IDataReader GetConcern(int concernId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ConcernGet", concernId);
        }

        public static IDataReader ListConcern()
        {
            return SqlHelper.ExecuteReader(ConnectString, "ConcernList");
        }
        #endregion

        #region Location
        public static int InsertLocation(string locationName, int locationTypeId, string sortDescription, string detailDescription, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string code)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "LocationInsert", locationName, locationTypeId, sortDescription, detailDescription, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status,code));
        }

        public static void UpdateLocation(int locationId, string locationName, int locationTypeId, string sortDescription, string detailDescription, int continentId, int nationalId, int cityId, int districtId, int wardId, string address, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string code)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LocationUpdate", locationId, locationName, locationTypeId, sortDescription, detailDescription, continentId, nationalId, cityId, districtId, wardId, address, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, code);
        }

        public static void DeleteLocation(int locationId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LocationDelete", locationId);
        }

        public static IDataReader GetLocation(int locationId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "LocationGet", locationId);
        }

        public static IDataReader ListLocation()
        {
            return SqlHelper.ExecuteReader(ConnectString, "LocationList");
        }
        #endregion

        #region LocationType
        public static int InsertLocationType(string locationTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "LocationTypeInsert", locationTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateLocationType(int locationTypeId, string locationTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LocationTypeUpdate", locationTypeId, locationTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteLocationType(int locationTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "LocationTypeDelete", locationTypeId);
        }

        public static IDataReader GetLocationType(int locationTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "LocationTypeGet", locationTypeId);
        }

        public static IDataReader ListLocationType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "LocationTypeList");
        }
        #endregion

        #region Schedule
        public static int InsertSchedule(int beginLocation, int endLocation, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleType)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "ScheduleInsert", beginLocation, endLocation, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleType));
        }

        public static void UpdateSchedule(int scheduleId, int beginLocation, int endLocation, int updatedBy, DateTime updatedDate, int status, int scheduleType)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ScheduleUpdate", scheduleId, beginLocation, endLocation, GetNull(updatedBy), GetNull(updatedDate), status, scheduleType);
        }

        public static void DeleteSchedule(int scheduleId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ScheduleDelete", scheduleId);
        }

        public static IDataReader GetSchedule(int scheduleId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ScheduleGet", scheduleId);
        }

        public static IDataReader ListSchedule()
        {
            return SqlHelper.ExecuteReader(ConnectString, "ScheduleList");
        }
        #endregion

        #region Type
        public static int InsertType(string typeName, int typeOf, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TypeInsert", typeName, typeOf, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateType(int typeId, string typeName, int typeOf, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TypeUpdate", typeId, typeName, typeOf, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteType(int typeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TypeDelete", typeId);
        }

        public static IDataReader GetType(int typeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TypeGet", typeId);
        }

        public static IDataReader ListType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TypeList");
        }
        #endregion

        #region Age
        public static int InsertAge(string ageName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "AgeInsert", ageName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateAge(int ageId, string ageName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AgeUpdate", ageId, ageName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteAge(int ageId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "AgeDelete", ageId);
        }

        public static IDataReader GetAge(int ageId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "AgeGet", ageId);
        }

        public static IDataReader ListAge()
        {
            return SqlHelper.ExecuteReader(ConnectString, "AgeList");
        }
        #endregion

        #region Stay
        public static int InsertStay(int priceId, DateTime onDate, DateTime offDate, int roomQuantity, decimal totalPrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "StayInsert", priceId, onDate,offDate,roomQuantity,totalPrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleId));
        }

        public static void UpdateStay(int stayId, int priceId, DateTime onDate, DateTime offDate, int roomQuantity, decimal totalPrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "StayUpdate", stayId, priceId, onDate, offDate, roomQuantity, totalPrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleId);
        }

        public static void DeleteStay(int stayId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "StayDelete", stayId);
        }

        public static IDataReader GetStay(int stayId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "StayGet", stayId);
        }

        public static IDataReader ListStay()
        {
            return SqlHelper.ExecuteReader(ConnectString, "StayList");
        }
        public static IDataReader ListStayByIds(string stayIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "StayListByIds", stayIds);
        }
        #endregion

        #region Price
        public static int InsertPrice(int itemId, int itemType, int ageId, string time, int nationalId, decimal salePrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string season, DateTime beginDate, DateTime endDate, int ticketType, int rated, string flightArrivals, decimal salePriceChild)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "PriceInsert", itemId, itemType, ageId, time, nationalId, salePrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, season, beginDate, endDate, ticketType, rated, flightArrivals,salePriceChild));
        }

        public static void UpdatePrice(int priceId, int itemId, int itemType, int ageId, string time, int nationalId, decimal salePrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string season, DateTime beginDate, DateTime endDate, int ticketType, int rated, string flightArrivals, decimal salePriceChild)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PriceUpdate", priceId, itemId, itemType, ageId, time, nationalId, salePrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, season, beginDate, endDate, ticketType, rated, flightArrivals, salePriceChild);
        }

        public static void DeletePrice(int priceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PriceDelete", priceId);
        }

        public static IDataReader GetPrice(int priceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceGet", priceId);
        }
        public static IDataReader GetPriceByRoom(int roomId,DateTime beginDate)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceByRoomGet", roomId,beginDate);
        }

        public static IDataReader ListPrice()
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceList");
        }
        public static IDataReader ListPriceByType(int type)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListByType", type);
        }
        public static IDataReader ListPriceByHotelAndType(int type)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListByHotelAndType", type);
        }

        public static IDataReader ListPriceBySchedule(int type,int schedule)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListBySchedule", type,schedule);
        }
        public static IDataReader ListPriceBy(int type, int scheduleId, DateTime date, string flightArrival, int concernId, string seasion)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListBy", type, scheduleId, date, flightArrival, concernId, seasion);
        }
      
        public static IDataReader ListPriceByCar(int type, int scheduleId, DateTime date, string soCho, int concernId,int yearCar,string seasion)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListByCar", type, scheduleId, date, soCho, concernId, yearCar, seasion);
        }
        public static IDataReader ListPriceByMenu(int type, int restaurantId, int menuTypeId, string seasonTour, DateTime date)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListByMenu", type, restaurantId, menuTypeId, seasonTour, date);
        }

        public static IDataReader ListPriceByDvk(int type, int partnerId, int locationId, string seasonTour)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceListByDvk", type, partnerId, locationId, seasonTour);
        }

        public static IDataReader GetPriceByInsurance(int insuranceId, DateTime beginDate)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceByInsuranceGet", insuranceId, beginDate);

        }
        #endregion

        #region PriceItem
        public static int InsertPriceItem(string priceItemName, int scheduleId, int priceId, int quantity, decimal totalPrice, int priceItemType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, DateTime goDate)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "PriceItemInsert", priceItemName, scheduleId, priceId, quantity, totalPrice, priceItemType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, goDate));
        }

        public static void UpdatePriceItem(int priceItemId, string priceItemName, int scheduleId, int priceId, int quantity, decimal totalPrice, int priceItemType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, DateTime goDate)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PriceItemUpdate", priceItemId, priceItemName, scheduleId, priceId, quantity, totalPrice, priceItemType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, goDate);
        }

        public static void DeletePriceItem(int priceItemId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "PriceItemDelete", priceItemId);
        }

        public static IDataReader GetPriceItem(int priceItemId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceItemGet", priceItemId);
        }

        public static IDataReader ListPriceItem()
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceItemList");
        }
        public static IDataReader ListPriceItemBySchedule(int scheduleId, string priceItemType)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceItemListBySchedule", scheduleId, priceItemType);
        }
        public static IDataReader ListPriceItemByIds(string priceItemIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "PriceItemListByIds", priceItemIds);
        }
        #endregion

        #region Tour
        public static int InsertTour(string tourName, 
                                        int tourTypeId,
                                        int groupType, 
                                        int locationBegin, 
                                        int scheduleId, 
                                        int quantityAdult, 
                                        int quantityChild, 
                                        DateTime beginDate, 
                                        DateTime endDate,
                                        int quantityDay,
                                        int quantityNight,
                                        int createdBy, 
                                        DateTime createdDate, 
                                        int updatedBy, 
                                        DateTime updatedDate, 
                                        int status,
                                        string season,
                                        string martName)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TourInsert", tourName, 
                                                                                        tourTypeId,
                                                                                        groupType, 
                                                                                        locationBegin, 
                                                                                        scheduleId, 
                                                                                        quantityAdult, 
                                                                                        quantityChild, 
                                                                                        beginDate, 
                                                                                        endDate,
                                                                                        quantityDay,
                                                                                        quantityNight,
                                                                                        createdBy, 
                                                                                        createdDate, 
                                                                                        GetNull(updatedBy), 
                                                                                        GetNull(updatedDate), 
                                                                                        status,
                                                                                        season,
                                                                                        martName));
        }

        public static void UpdateTour(int tourId, 
                                        string tourName,
                                        int tourTypeId,
                                        int groupType,
                                        int locationBegin,
                                        int scheduleId,
                                        int quantityAdult,
                                        int quantityChild,
                                        DateTime beginDate,
                                        DateTime endDate,
                                        int quantityDay,
                                        int quantityNight,
                                        int createdBy,
                                        DateTime createdDate,
                                        int updatedBy,
                                        DateTime updatedDate,
                                        int status,
                                        string season,
                                        string martName)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourUpdate", tourId,
                                                                    tourName, 
                                                                    tourTypeId,
                                                                    groupType, 
                                                                    locationBegin, 
                                                                    scheduleId, 
                                                                    quantityAdult, 
                                                                    quantityChild, 
                                                                    beginDate, 
                                                                    endDate,
                                                                    quantityDay,
                                                                    quantityNight,
                                                                    createdBy, 
                                                                    createdDate, 
                                                                    GetNull(updatedBy), 
                                                                    GetNull(updatedDate), 
                                                                    status,
                                                                    season,
                                                                    martName);
        }

        public static void DeleteTour(int tourId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourDelete", tourId);
        }

        public static IDataReader GetTour(int tourId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourGet", tourId);
        }

        public static IDataReader ListTour()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourList");
        }
        #endregion

        #region TourType
        public static int InsertTourType(string tourTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TourTypeInsert",  tourTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateTourType(int tourTypeId, string tourTypeName, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourTypeUpdate", tourTypeId, tourTypeName, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteTourType(int tourTypeId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourTypeDelete", tourTypeId);
        }

        public static IDataReader GetTourType(int tourTypeId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourTypeGet", tourTypeId);
        }

        public static IDataReader ListTourType()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourTypeList");
        }
       
        #endregion

        #region TourPackage
        public static int InsertTourPackage(string tourPackageName, string tickets, decimal ticketPrices, string hotels, decimal hotelPrices, string restaurant, decimal restaurantPrices, string visas, decimal visaPrices, string insurance, decimal insurancePrices, string travelGuideCashs, decimal travelGuideCashPrices, string services, decimal servicePrices, decimal totalPrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId, string description, string tourPackageCode, string martName, string commissions, decimal commissionPrice)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TourPackageInsert", tourPackageName, GetNull(tickets), ticketPrices, GetNull(hotels), hotelPrices, GetNull(restaurant), restaurantPrices, GetNull(visas), visaPrices, GetNull(insurance), insurancePrices, GetNull(travelGuideCashs), travelGuideCashPrices, GetNull(services), servicePrices, totalPrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleId, description, tourPackageCode, martName, commissions, commissionPrice));
        }

        public static void UpdateTourPackage(int tourPackageId, string tourPackageName, string tickets, decimal ticketPrices, string hotels, decimal hotelPrices, string restaurant, decimal restaurantPrices, string visas, decimal visaPrices, string insurance, decimal insurancePrices, string travelGuideCashs, decimal travelGuideCashPrices, string services, decimal servicePrices, decimal totalPrice, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId, string description, string tourPackageCode, string martName, string commissions, decimal commissionPrice)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourPackageUpdate", tourPackageId, tourPackageName, GetNull(tickets), ticketPrices, GetNull(hotels), hotelPrices, GetNull(restaurant), restaurantPrices, GetNull(visas), visaPrices, GetNull(insurance), insurancePrices, GetNull(travelGuideCashs), travelGuideCashPrices, GetNull(services), servicePrices, totalPrice, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleId, description, tourPackageCode, martName, commissions, commissionPrice);
        }

        public static void DeleteTourPackage(int tourPackageId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourPackageDelete", tourPackageId);
        }

        public static IDataReader GetTourPackage(int tourPackageId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourPackageGet", tourPackageId);
        }

        public static IDataReader ListTourPackage()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourPackageList");
        }
        #endregion

        #region TourFull
        public static int InsertTourFull(int tourId, int tourPackageId, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string dateQuantity)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TourFullInsert", tourId, tourPackageId, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, dateQuantity));
        }

        public static void UpdateTourFull(int tourFullId, int tourId, int tourPackageId, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, string dateQuantity)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourFullUpdate", tourFullId, tourId, tourPackageId, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, dateQuantity);
        }

        public static void DeleteTourFull(int tourFullId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourFullDelete", tourFullId);
        }

        public static IDataReader GetTourFull(int tourFullId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourFullGet", tourFullId);
        }

        public static IDataReader ListTourFull()
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourFullList");
        }
        public static IDataReader GetTourFullByTour(int tourId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "GetTourFullByTour", tourId);
        }
        #endregion

        #region Service
        public static int InsertService(string serviceName, int locationId, string note, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int partnerId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "ServiceInsert", serviceName, locationId, note, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, partnerId));
        }

        public static void UpdateService(int serviceId, string serviceName, int locationId, string note, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int partnerId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ServiceUpdate", serviceId, serviceName, locationId, note, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, partnerId);
        }

        public static void DeleteService(int serviceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "ServiceDelete", serviceId);
        }

        public static IDataReader GetService(int serviceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ServiceGet", serviceId);
        }

        public static IDataReader ListService()
        {
            return SqlHelper.ExecuteReader(ConnectString, "ServiceList");
        }
        public static IDataReader ListServiceByPartnerAndLocation(int partnerId,int locationId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "ServiceListByPartnerAndLocation", partnerId, locationId);
        }
        #endregion

        #region Commission
        public static int InsertCommission(string recipient, int quantity, decimal price,decimal total, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "CommissionInsert", recipient, quantity, price,total, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status, scheduleId));
        }

        public static void UpdateCommission(int commissionId, string recipient, int quantity, decimal price, decimal total, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status, int scheduleId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "CommissionUpdate", commissionId, recipient, quantity, price,total, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status,scheduleId);
        }

        public static void DeleteCommission(int commissionId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "CommissionDelete", commissionId);
        }

        public static IDataReader GetCommission(int commissionId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CommissionGet", commissionId);
        }

        public static IDataReader ListCommission()
        {
            return SqlHelper.ExecuteReader(ConnectString, "CommissionList");
        }
        public static IDataReader ListCommissionBySchedule(int scheduleId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CommissionListBySchedule", scheduleId);
        }
        public static IDataReader ListCommissionByIds(string commissionIds)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CommissionListByIds", commissionIds);
        }
        #endregion


        #region Calculator
        public static int InsertCalculator(int tourId, int itemId, int itemType, DateTime dateBegin, DateTime dateEnd, decimal priceAdults, decimal priceChild, int quantityCar, int quantityAdults, int quantityChild, double vat, decimal translateAdult, decimal translateChild, decimal otherCostAdult, decimal otherCostChild,string travelGuideType)
        {

 
            //return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "CalculatorInsert", tourId, itemId, itemType,  GetNull(dateBegin), GetNull(dateEnd), GetNull(priceAdults), GetNull(priceChild), GetNull(quantityCar), GetNull(quantityAdults), GetNull(quantityChild), GetNull(vat),GetNull(translateAdult),GetNull(translateChild),GetNull(otherCostAdult),GetNull(otherCostChild)));
 
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "CalculatorInsert", tourId, itemId, itemType, GetNull(dateBegin), GetNull(dateEnd), priceAdults, GetNull(priceChild), GetNull(quantityCar), GetNull(quantityAdults), GetNull(quantityChild), GetNull(vat), GetNull(translateAdult), GetNull(translateChild), GetNull(otherCostAdult), GetNull(otherCostChild), GetNull(travelGuideType)));
 

        }

        public static void UpdateCalculator(int calculatorId, int tourId, int itemId, int itemType, DateTime dateBegin, DateTime dateEnd, decimal priceAdults, decimal priceChild, int quantityCar, int quantityAdults, int quantityChild, double vat, decimal translateAdult, decimal translateChild, decimal otherCostAdult, decimal otherCostChild, string travelGuideType)
        {

            SqlHelper.ExecuteNonQuery(ConnectString, "CalculatorUpdate", calculatorId, tourId, itemId, itemType,  GetNull(dateBegin), GetNull(dateEnd), priceAdults, GetNull(priceChild), GetNull(quantityCar), GetNull(quantityAdults), GetNull(quantityChild), GetNull(vat), GetNull(translateAdult), GetNull(translateChild), GetNull(otherCostAdult), GetNull(otherCostChild), GetNull(travelGuideType));


        }

        public static void DeleteCalculator(int calculatorId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "CalculatorDelete", calculatorId);
        }

        public static IDataReader GetCalculatorDvk(int calculatorId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CalculatorGetDvk", calculatorId);
        }
        public static IDataReader GetCalculator(int calculatorId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "CalculatorGet", calculatorId);
        }
        public static IDataReader ListCalculator()
        {
            return SqlHelper.ExecuteReader(ConnectString, "CalculatorList");
        }
        public static IDataReader ListCalculatorDvk()
        {
            return SqlHelper.ExecuteReader(ConnectString, "CalculatorListDvk");
        }

        #endregion

        #region TourService
        public static int InsertTourService(int tourId, int serviceId, int serviceType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            return Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectString, "TourServiceInsert", tourId, serviceId, serviceType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status));
        }

        public static void UpdateTourService(int tourServiceId, int tourId, int serviceId, int serviceType, int createdBy, DateTime createdDate, int updatedBy, DateTime updatedDate, int status)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourServiceUpdate", tourServiceId, tourId,serviceId,serviceType, createdBy, createdDate, GetNull(updatedBy), GetNull(updatedDate), status);
        }

        public static void DeleteTourService(int tourServiceId)
        {
            SqlHelper.ExecuteNonQuery(ConnectString, "TourServiceDelete", tourServiceId);
        }

        public static IDataReader GetTourService(int tourserviceId)
        {
            return SqlHelper.ExecuteReader(ConnectString, "TourServiceGet", tourserviceId);

        }
        #endregion
    }
}
